1. Technical Field
This disclosure relates generally to graphics processing, and more specifically to implementation of gradient-type instructions.
2. Description of the Related Art
Graphics processing units (GPUs) within computer systems typically include multiple execution pipelines (often referred to as “execution instances”) that operate on data in parallel. Typically, execution instances operate on fragments or pixels of an image independently. For example, each execution instance uses data for a given pixel and does not use data from other pixels being adjusted by other instances. However, gradient instructions use data from other execution instances to compute rates of change for fragment shader variables. For example, execution instances are often grouped to receive 2×2 blocks of pixels and controlled as a group. To execute gradient instructions, each execution instance may need an operand from another execution instance in the 2×2 group. Thus, each execution instance may receive operands from itself and another execution instance (e.g., a horizontal or vertical neighbor in the 2×2 group) for gradient-type operations. The OPENGL® dfdx and dfdy instructions are examples of gradient-type instructions. Operands may be available from multiple locations such as: a register file, storage elements within each execution instance, as a forwarded result at an output of an execution unit, etc. Routing operands from these different locations among groups of execution instances in order to provide operands for gradient instructions may consume considerable power and routing resources. GPUs are often used in mobile devices where battery power is limited and power consumption may be an important design consideration.